
use "../2_Data/temp/data_selected_region.dta", clear

la var post_election "Post $\times$ Campaign"
la var totale_casi "Cases"
la var deceduti "Deaths"
la var terapia "ICU"
la var totale_osp "Hosp."
la var tamponi "Tests"
la var daily_increase "Cases"
la var deceduti_day "Deaths"
la var tamponi_day "Tests"
la var ratio2 "\% Positive"

global tab_name table_regional_boundary_controls

eststo clear

rename Hospital_migration Hosp_migr

foreach var of varlist surface density Hosp_migr Unemployment Employment* RSA Fiber Mobility Tourism Childcare mount_surface Coastal_surface museums Export south share_municipal {
egen st_`var'=std(`var')
replace `var'=st_`var'
gen `var'_post=`var'*trend
local controls `controls' `var'_post

}

reg2hdfespatial daily_increase post_election `controls', lat(x_region) lon(y_region) timevar(time_fe_region) panelvar(region_code) distcutoff(1300) lagcutoff(110) 
sum number_daily_increase if election==1 & post==0

reg2hdfespatial tamponi_day post_election `controls', lat(x_region) lon(y_region) timevar(time_fe_region) panelvar(region_code) distcutoff(1300) lagcutoff(110) 
sum number_tamponi_day if election==1 & post==0

reg2hdfespatial ratio2 post_election `controls', lat(x_region) lon(y_region) timevar(time_fe_region) panelvar(region_code) distcutoff(1300) lagcutoff(110) 
sum number_ratio2 if election==1 & post==0

reg2hdfespatial totale_osp post_election `controls', lat(x_region) lon(y_region) timevar(time_fe_region) panelvar(region_code) distcutoff(1300) lagcutoff(110) 
sum number_totale_osp if election==1 & post==0

reg2hdfespatial terapia post_election `controls', lat(x_region) lon(y_region) timevar(time_fe_region) panelvar(region_code) distcutoff(1300) lagcutoff(110) 
sum number_terapia if election==1 & post==0

reg2hdfespatial deceduti_day post_election `controls', lat(x_region) lon(y_region) timevar(time_fe_region) panelvar(region_code) distcutoff(1300) lagcutoff(110) 
sum number_deceduti_day if election==1 & post==0


